From 6f195b64890e08d3fbbbb792f45a7d94d641c914 Mon Sep 17 00:00:00 2001
From: mancha <mancha1 AT zoho DOT com>
Date: Wed, 18 Feb 2015
Subject: Fix inactive account determination

sesman: fix so shadow accounts aren't incorrectly classified "inactive"
as might happen if sp_max/sp_inact fields are empty or sp_lstchg=0.

---
 sesman/verify_user.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/sesman/verify_user.c
+++ b/sesman/verify_user.c
@@ -323,7 +323,10 @@ auth_account_disabled(struct spwd* stp)
     return 1;
   }
 
-  if (today >= (stp->sp_lstchg+stp->sp_max+stp->sp_inact))
+  if ((stp->sp_max >= 0) &&
+      (stp->sp_inact >= 0) &&
+      (stp->sp_lstchg > 0) &&
+      (today >= (stp->sp_lstchg + stp->sp_max + stp->sp_inact)))
   {
     return 1;
   }
